// Example in using d_sort.h and StopWatch.h
#include "StopWatch.h"
#include "d_sort.h"
#include <iostream>
#include <vector>

using namespace std;

int main()
{
  int size = 100000; // define number of integers in test
  StopWatch s; // instanse of the watch
  double t;
  vector<int> v1, v2, v3; // three vectors that shall hold
                          // all data to be used with all sortings

  cout << "Create basis" << endl;
  testPackage p(v1, v2, v3, size); // create data

  vector<int> v_test(size); // the vector used in sorting
  long maxval = p.highVal(); // get the largest number under tset
                             // used with radixSort

  cout << "Start sorting" << endl;
  v_test = v1; // copy original random list to test vector
  s.start(); // start the watch
  radixSort(v_test, maxval); // do the sorting
  t = s.stop(); // stop and read the watch

  cout << "Radix sort " << size << " random numbers, time " << t << " sec" << endl;

  v_test = v2; // copy original ascending data to test vector
  s.start();  // start watch
  quicksort(v_test); // do the sorting
  t = s.stop(); // stop and read the watch

  cout << "Quick sort " << size << " ascending numbers, time " << t << " sec" << endl;

  system("PAUSE");
  return 0;
}
